package com.yohann.oss.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * <p>
 * oss配置类
 * </p>
 *
 * @author Yohann
 * @since 2020/8/7
 */
@Component
public class ConstantConfig  implements InitializingBean {
    //读取配置文件
    @Value("${aliyun.oss.file.endpoint}")
    private String endpoint;

    @Value("${aliyun.oss.file.keyid}")
    private String keyId;

    @Value("${aliyun.oss.file.keysecret}")
    private String keySecret;

    @Value("${aliyun.oss.file.bucketname}")
    private String bucketName;

    public static String END_POIND;
    public static String END_KEYID;
    public static String END_KEYSECRET;
    public static String END_BUCKETNAME;

    @Override
    public void afterPropertiesSet() throws Exception {
        END_POIND = endpoint;
        END_KEYID = keyId;
        END_KEYSECRET = keySecret;
        END_BUCKETNAME = bucketName;
    }
}